<%@page import="org.apache.commons.dbutils.handlers.BeanListHandler"%>
<%@page import="cn.cjyll.C3P0DataSoure.JDBCUtilsC3P0"%>
<%@page import="org.apache.commons.dbutils.QueryRunner"%>
<%@page import="cn.cjyll.bean.shop"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="流量">
  <meta name="author" content="">
  <title>购买中心</title>

  <!-- <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Arimo:400,700,400italic">-->
 <link rel="stylesheet" href="${pageContext.request.contextPath }/management/assets/css/bootstrap.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath }/management/assets/css/xenon-core.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath }/management/assets/css/xenon-components.css">
  <link rel="stylesheet" href="${pageContext.request.contextPath }/management/assets/css/custom.css">

<jsp:include page="/management/user/head.jsp" />
<body class="page-body">
<jsp:include page="/management/user/nav.jsp" />
<%-- 获取商品列表 --%>
<%
    QueryRunner qr = new QueryRunner(JDBCUtilsC3P0.getDataSoure());
    String sql = "SELECT *FROM shop ORDER BY id DESC";
    List<shop> list = qr.query(sql,new BeanListHandler<shop>(shop.class));
    request.setAttribute("list", list);
%>

    <div  style="font-size:30px;">
                 流量商店
         <div  style="float:right;font-size:20px;"><img alt="购物车" width=60px height=60px src="${pageContext.request.contextPath }/management/assets/images/shop.jpg">
      购物车商品数量：<c:out value="${sessionScope.sl }">0</c:out>   &nbsp;   <a href="${pageContext.request.contextPath }/management/user/mydd.jsp" type="submit" class="btn btn-info">  立 即 结 算  </a>
          
           </div>
            </div>

            <hr>

            
            <div class="row">
                    
        <div id="addtype_list" class="row">
          <c:forEach items="${requestScope.list }" var="i">
            <div class="col-sm-4">
       <div class="xe-widget xe-todo-list xe-todo-list-turquoise">
             <div class="xe-header">
                <div class="xe-icon">
               <i class="fa-credit-card"></i>
                            </div>
                       <div class="xe-label">
                       <strong>${i.sname }</strong>
            </div>
          </div>
          <div class="xe-body">
            
            <ul class="list-unstyled">
              <li>
                <label>
              
                  <span>使用时间:${i.sdays }天</span>
                </label>
              </li>
              <li>
                <label>
              
                  <span>包含流量:${i.sll }GB</span>
                </label>
              </li>
              <li>
                <label>
                  <span>商品价格:￥${i.sprice }元</span>
                </label>
              </li>
               <li>
                <label>
              
                  <span>商品备注:${i.sbz }</span>
                </label>
              </li>
            </ul>
            
          </div>
                 <div class="xe-footer">
                   <a href="${pageContext.request.contextPath }/addGwc?sl=${sessionScope.sl+1}&id=${i.id }&sprice=${i.sprice}&sdays=${i.sdays}&sll=${i.sll}" type="submit" class="btn btn-white btn-single btn-block">加入购物车</a></div>
          </div>
         
      </div>
       </c:forEach>
    </div>
   </div>

        
<jsp:include page="copy.jsp"></jsp:include>